<?php

namespace app\libs\TongtuSDK\Model;

class BuyerInfo
{
        protected string $buyerAccount;
        protected string $buyerAddress1;
        protected string $buyerAddress2;
        protected string $buyerAddress3;
        protected string $buyerCity;
        protected string $buyerCompany;
        protected string $buyerCountryCode;
        protected string $buyerEmail;
        protected string $buyerMobilePhone;
        protected string $buyerName;
        protected string $buyerPassportCode;
        protected string $buyerPhone;
        protected string $buyerPostalCode;
        protected string $buyerState;

    /**
     * @return string
     */
    public function getBuyerAccount(): string
    {
        return $this->buyerAccount;
    }

    /**
     * @param string $buyerAccount
     */
    public function setBuyerAccount(string $buyerAccount): BuyerInfo
    {
        $this->buyerAccount = $buyerAccount;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerAddress1(): string
    {
        return $this->buyerAddress1;
    }

    /**
     * @param string $buyerAddress1
     */
    public function setBuyerAddress1(string $buyerAddress1): BuyerInfo
    {
        $this->buyerAddress1 = $buyerAddress1;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerAddress2(): string
    {
        return $this->buyerAddress2;
    }

    /**
     * @param string $buyerAddress2
     */
    public function setBuyerAddress2(string $buyerAddress2): BuyerInfo
    {
        $this->buyerAddress2 = $buyerAddress2;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerAddress3(): string
    {
        return $this->buyerAddress3;
    }

    /**
     * @param string $buyerAddress3
     */
    public function setBuyerAddress3(string $buyerAddress3): BuyerInfo
    {
        $this->buyerAddress3 = $buyerAddress3;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerCity(): string
    {
        return $this->buyerCity;
    }

    /**
     * @param string $buyerCity
     */
    public function setBuyerCity(string $buyerCity): BuyerInfo
    {
        $this->buyerCity = $buyerCity;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerCompany(): string
    {
        return $this->buyerCompany;
    }

    /**
     * @param string $buyerCompany
     */
    public function setBuyerCompany(string $buyerCompany): BuyerInfo
    {
        $this->buyerCompany = $buyerCompany;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerCountryCode(): string
    {
        return $this->buyerCountryCode;
    }

    /**
     * @param string $buyerCountryCode
     */
    public function setBuyerCountryCode(string $buyerCountryCode): BuyerInfo
    {
        $this->buyerCountryCode = $buyerCountryCode;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerEmail(): string
    {
        return $this->buyerEmail;
    }

    /**
     * @param string $buyerEmail
     */
    public function setBuyerEmail(string $buyerEmail): BuyerInfo
    {
        $this->buyerEmail = $buyerEmail;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerMobilePhone(): string
    {
        return $this->buyerMobilePhone;
    }

    /**
     * @param string $buyerMobilePhone
     */
    public function setBuyerMobilePhone(string $buyerMobilePhone): BuyerInfo
    {
        $this->buyerMobilePhone = $buyerMobilePhone;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerName(): string
    {
        return $this->buyerName;
    }

    /**
     * @param string $buyerName
     */
    public function setBuyerName(string $buyerName): BuyerInfo
    {
        $this->buyerName = $buyerName;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerPassportCode(): string
    {
        return $this->buyerPassportCode;
    }

    /**
     * @param string $buyerPassportCode
     */
    public function setBuyerPassportCode(string $buyerPassportCode): BuyerInfo
    {
        $this->buyerPassportCode = $buyerPassportCode;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerPhone(): string
    {
        return $this->buyerPhone;
    }

    /**
     * @param string $buyerPhone
     */
    public function setBuyerPhone(string $buyerPhone): BuyerInfo
    {
        $this->buyerPhone = $buyerPhone;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerPostalCode(): string
    {
        return $this->buyerPostalCode;
    }

    /**
     * @param string $buyerPostalCode
     */
    public function setBuyerPostalCode(string $buyerPostalCode): BuyerInfo
    {
        $this->buyerPostalCode = $buyerPostalCode;
        return $this;
    }

    /**
     * @return string
     */
    public function getBuyerState(): string
    {
        return $this->buyerState;
    }

    /**
     * @param string $buyerState
     */
    public function setBuyerState(string $buyerState): BuyerInfo
    {
        $this->buyerState = $buyerState;
        return $this;
    }

    public function toArray()
    {
        $params = [
            'buyerEmail'=>$this->getBuyerEmail(),
            'buyerAddress1'=>$this->getBuyerAddress1(),
            'buyerCity'=>$this->getBuyerCity(),
            'buyerCountryCode'=>$this->getBuyerCountryCode(),
            'buyerMobilePhone'=>$this->getBuyerMobilePhone(),
            'buyerPostalCode'=>$this->getBuyerPostalCode(),
            'buyerName' => $this->getBuyerName(),
        ];

        if($this->getBuyerState()) $params['buyerState'] = $this->getBuyerState();
        if($this->getBuyerAccount()) $params['buyerAccount'] = $this->getBuyerAccount();
        return $params;
    }


}
